/**
 * Copyright (C) 2017 - 2020 https://github.com/joewee
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.game.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 中奖名单
 *
 * @author joewee
 * @version 1.0.0
 * @Date 2018/5/8 20:14
 */
@Entity
@Table(name = "LOTTERY_GAME_WINNER")
public class LotteryGameWinner implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID", unique = true, nullable = false)
    private Long id;
    /**
     * 奖品
     */
    @JoinColumn(name = "AWARD_ID")
    @ManyToOne(fetch = FetchType.LAZY)
    private LotteryAward lotteryAward;
    /**
     * 游戏
     */
    @JoinColumn(name = "GAME_ID")
    @ManyToOne(fetch = FetchType.LAZY)
    private LotteryGame lotteryGame;
    /**
     * 中奖者id
     */
    @Column(name = "WINNER_ID")
    private String winnerId;
    /**
     * 中奖者name
     */
    @Column(name = "WINNER_NAME")
    private String winnerName;
    /**
     * 中奖者地址
     */
    @Column(name = "ADDRESS")
    private String address;
    /**
     * 中奖数量
     */
    @Column(name = "QUANTITY")
    private Integer quantity =1;
    /**
     * 兑换状态
     */
    @Column(name = "STATUS")
    @Enumerated(value = EnumType.STRING)
    private ExchangeStatus status = ExchangeStatus.NOT_EXCHANGE;
    /**
     * 兑换时间
     */
    @Column(name = "EXCHANGE_TIME")
    private Date exchangeTime;
    /**
     * 中奖时间
     */
    @Column(name = "WIN_TIME")
    private Date winTime = new Date();
    /**
     * 备注
     */
    @Column(name = "REMARK")
    private String remark;
    /**
     * 兑换码
     */
    @Column(name = "EXCHANGE_CODE")
    private String exchangeCode;

    public enum ExchangeStatus {
        /**
         * 未兑换
         */
        NOT_EXCHANGE,
        /**
         * 已确认
         */
        CONFIRMED,
        /**
         * 已兑换
         */
        EXCHANGED;
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public LotteryAward getLotteryAward() {
        return lotteryAward;
    }

    public void setLotteryAward(LotteryAward lotteryAward) {
        this.lotteryAward = lotteryAward;
    }

    public LotteryGame getLotteryGame() {
        return lotteryGame;
    }

    public void setLotteryGame(LotteryGame lotteryGame) {
        this.lotteryGame = lotteryGame;
    }

    public String getWinnerId() {
        return winnerId;
    }

    public void setWinnerId(String winnerId) {
        this.winnerId = winnerId;
    }

    public String getWinnerName() {
        return winnerName;
    }

    public void setWinnerName(String winnerName) {
        this.winnerName = winnerName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public ExchangeStatus getStatus() {
        return status;
    }

    public void setStatus(ExchangeStatus status) {
        this.status = status;
    }

    public Date getExchangeTime() {
        return exchangeTime;
    }

    public void setExchangeTime(Date exchangeTime) {
        this.exchangeTime = exchangeTime;
    }

    public Date getWinTime() {
        return winTime;
    }

    public void setWinTime(Date winTime) {
        this.winTime = winTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getExchangeCode() {
        return exchangeCode;
    }

    public void setExchangeCode(String exchangeCode) {
        this.exchangeCode = exchangeCode;
    }
}
